﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;

namespace TCDC_System.Content.Systems
{
    public partial class sys_errorlog : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Read_Errorlog();
        }

        protected void Refresh(object sender, EventArgs e)
        {
            Read_Errorlog();
        }

        protected void Read_Errorlog()
        {
            try
            {
                using (StreamReader sr = new StreamReader(Server.MapPath("../../Logs/Error.txt")))
                {
                    String line = sr.ReadToEnd();
                    TxtErorMassage.Text = line;
                }
            }
            catch (Exception ex)
            {
                TxtErorMassage.Text = "Could not read the file" + ex.ToString();
            }
        }
    }
}